{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}G:\My Drive\Replications\Schwander\Log_Createfile_Schwander_PSRM.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}22 Feb 2019, 10:15:50
{txt}
{com}. 
. use "LSF_1992-2015.dta", clear
{txt}
{com}. 
.  
. ***************************************
. ** label important variables
. ***************************************
. label var wstator "labor status during ref week"
{txt}
{com}. 
. #delimit;
{txt}delimiter now ;
{com}. label define wstator
> 1 "did work during the reference week"
> 2 "Was not working but had a job or business from which he/she was absent during the reference week"
> 3 "Was not working because on lay-off"
> 4 "Was a conscript on compulsory military or community service"
> 5 "Other who neither worked nor had a job or business during the reference week"
> 9 "Not applicable (child less than 15 years old)", modify;
{txt}
{com}. label values wstator wstator;
{txt}
{com}. #delimit cr
{txt}delimiter now cr
{com}. 
. 
. 
. label define ilostat 1 "Employed" 2 "Unemployed" 3 "Inactive" 4 "Compulsory military service" 9 "Persons less than 15 years old", modify
{txt}
{com}. label values ilostat ilostat
{txt}
{com}. 
. 
. ***************************************
. *** create the socio-structural variables
. ***************************************
. recode sex (1=0 "male") (2=1 "female"), gen(gender)
{txt}(39687268 differences between sex and gender)

{com}. la var gender "gender"
{txt}
{com}. 
. gen workage =.
{txt}(39,687,268 missing values generated)

{com}. replace workage =1 if age >=17 & age <=67
{txt}(39,687,268 real changes made)

{com}. 
. 
. drop if workage !=1
{txt}(0 observations deleted)

{com}. 
. gen young =.
{txt}(39,687,268 missing values generated)

{com}. replace young =1 if age == 17
{txt}(3,452,718 real changes made)

{com}. replace young =1 if age == 22
{txt}(3,316,094 real changes made)

{com}. replace young =1 if age == 27
{txt}(3,338,272 real changes made)

{com}. replace young =1 if age == 32
{txt}(3,630,258 real changes made)

{com}. replace young =0 if age >= 37
{txt}(25,949,926 real changes made)

{com}. la var young "young (17-36y)"
{txt}
{com}. 
. 
. *education: HATLEV1D
. gen education= .
{txt}(39,687,268 missing values generated)

{com}. replace education = 1 if hatlev1d == "L"
{txt}(15,720,279 real changes made)

{com}. replace education = 2 if hatlev1d == "M"
{txt}(14,923,299 real changes made)

{com}. replace education = 3 if hatlev1d == "H"
{txt}(7,524,687 real changes made)

{com}. 
. label define education 1 "Low-skilled: Lower secondary" 2 "Skilled: Upper secondary" 3 "High-skilled: Third level"
{txt}
{com}. la val education education
{txt}
{com}. 
. 
. 
. 
. gen hswomen =.
{txt}(39,687,268 missing values generated)

{com}. replace hswomen = 1 if gender == 1 & education ==3
{txt}(3,881,128 real changes made)

{com}. replace hswomen = 0 if gender == 0
{txt}(19,447,105 real changes made)

{com}. replace hswomen = 0 if gender == 1 & education <3
{txt}(15,568,691 real changes made)

{com}. 
. gen hsyoung = .
{txt}(39,687,268 missing values generated)

{com}. replace hsyoung = 1 if young == 1 & education ==3
{txt}(2,426,899 real changes made)

{com}. replace hsyoung = 0 if young == 0
{txt}(25,949,926 real changes made)

{com}. replace hsyoung = 0 if young == 1 & education <3
{txt}(10,712,645 real changes made)

{com}. 
. 
. ** labor market variables
. 
. gen involpt=.
{txt}(39,687,268 missing values generated)

{com}. replace involpt = 1 if ftptreas == 5
{txt}(969,514 real changes made)

{com}. replace involpt = 1 if ftptreas == 6
{txt}(1,541,277 real changes made)

{com}. replace involpt = 0 if ftptreas == 9
{txt}(35,136,008 real changes made)

{com}. replace involpt = 0 if ftptreas < 5
{txt}(1,833,312 real changes made)

{com}. 
. tab involpt

    {txt}involpt {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res} 36,969,320       93.64       93.64
{txt}          1 {c |}{res}  2,510,791        6.36      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res} 39,480,111      100.00
{txt}
{com}. 
. 
. gen partinv =.
{txt}(39,687,268 missing values generated)

{com}. replace partinv = 1 if ftpt == 2 & involpt ==1 
{txt}(2,510,791 real changes made)

{com}. replace partinv = 0 if ftpt == 1 
{txt}(18,770,677 real changes made)

{com}. replace partinv = 0 if ftpt == 2 & ftptreas ==0
{txt}(0 real changes made)

{com}. la var partinv "Inv. part-time"
{txt}
{com}. 
. recode ftpt (1=0 "not parttime") (2=1 "parttime") (9=.), gen(parttime)
{txt}(39620875 differences between ftpt and parttime)

{com}. la var parttime "parttime"
{txt}
{com}. 
. 
. 
. gen tempinv = .
{txt}(39,687,268 missing values generated)

{com}. replace tempinv = 1 if temp ==2 & tempreas !=1
{txt}(2,173,737 real changes made)

{com}. replace tempinv = 0 if temp ==1
{txt}(16,658,819 real changes made)

{com}. replace tempinv = 0 if temp ==2 & tempreas ==1
{txt}(396,398 real changes made)

{com}. la var tempinv "Inv. temporary"
{txt}
{com}. 
. 
. recode ilostat (1 3 4 =0 "not unemployed") (2 = 1 "unemployed") , gen(unempl)
{txt}(39687268 differences between ilostat and unempl)

{com}. la var unempl "Unemployed"
{txt}
{com}. 
. save "LSF_1992-2015_rec.dta", replace
{txt}(note: file LSF_1992-2015_rec.dta not found)
file LSF_1992-2015_rec.dta saved

{com}. 
. log close 
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}G:\My Drive\Replications\Schwander\Log_Createfile_Schwander_PSRM.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res}22 Feb 2019, 10:20:32
{txt}{.-}
{smcl}
{txt}{sf}{ul off}